use ClientDW_A

db.getCollection('GCOverallCompanySummaryExtended').find().forEach(function (item) {
    item.NonCompliantPrinciples.forEach(function(p) {
        if(p._id == 8) p._id = NumberInt(10)
    });
    item.WatchListPrinciples.forEach(function(p) {
        if(p._id == 8) p._id = NumberInt(10)
    });
    db.getCollection('GCOverallCompanySummaryExtended').save(item)
})

db.getCollection('GCPrincipleEventIndicatorExtended').update({PrincipleTemplateId: 8}, {$set: {PrincipleTemplateId: NumberInt(10)}}, {multi: true})

db.getCollection('GCPrincipleSummary').update({"Principle._id": 8}, {$set: {"Principle._id": NumberInt(10)}}, {multi: true})

db.getCollection('GCPrincipleSummaryExtended').update({"Principle._id": 8}, {$set: {"Principle._id": NumberInt(10)}}, {multi: true})

use ClientDW_B

db.getCollection('GCOverallCompanySummaryExtended').find().forEach(function (item) {
    item.NonCompliantPrinciples.forEach(function(p) {
        if(p._id == 8) p._id = NumberInt(10)
    });
    item.WatchListPrinciples.forEach(function(p) {
        if(p._id == 8) p._id = NumberInt(10)
    });
    db.getCollection('GCOverallCompanySummaryExtended').save(item)
})

db.getCollection('GCPrincipleEventIndicatorExtended').update({PrincipleTemplateId: 8}, {$set: {PrincipleTemplateId: NumberInt(10)}}, {multi: true})

db.getCollection('GCPrincipleSummary').update({"Principle._id": 8}, {$set: {"Principle._id": NumberInt(10)}}, {multi: true})

db.getCollection('GCPrincipleSummaryExtended').update({"Principle._id": 8}, {$set: {"Principle._id": NumberInt(10)}}, {multi: true})